#pragma once
#include <iostream>
#include <string>
#include <tuple>

struct person_name {
	std::string first_name;
	std::string mid_name;
	std::string last_name;

	//friend bool operator < (const person_name& this_obj, const person_name& other);
	std::strong_ordering operator <=> (const person_name& other) const = default;
};

// bool operator < (const person_name& this_obj, const person_name& other) {
//	// cpp++ 11 before
//	 //return this_obj.first_name < other.first_name
//		// || this_obj.first_name == other.first_name && this_obj.mid_name < other.mid_name
//		// || this_obj.first_name == other.first_name && this_obj.mid_name == other.mid_name && this_obj.last_name < other.last_name;
//
//	 //cpp++ 11 after
//
//	 return std::tie(this_obj.first_name, this_obj.mid_name, this_obj.last_name) < std::tie(other.first_name, other.mid_name, other.last_name);
//}

 void person_name_test(){
	 struct person_name p1 { .first_name = "zhao", .mid_name = "chun", .last_name = "yang" };
	 struct person_name p2 { .first_name = "zhao", .mid_name = "chun", .last_name = "tian" };

	 bool res = p1 != p2;
	 std::cout << "p1 < p2 :" << res << std::endl;
 }